<?php
	ini_set("display_errors", "off");

	 /*ajax返回*/
	function ajax_return($data)
	{
			header("Content-Type:text/html; charset=utf-8");
 	        echo(json_encode($data));
	        exit;
	}


class console
{
    public static function log($var)
    {
        self::scriptHead();
        self::format($var);
        self::scriptFoot();
    }

    private static function format($var)
    {
        $tmp = json_encode($var);
        echo 'var v = eval("(" +\'' .$tmp. '\'+ ")");';
        echo 'console.log(v);';
    }

    private static function scriptHead()
    {
        echo '<script language="javascript">';
    }

    private static function scriptFoot()
    {
        echo '</script>';
    }
}

?> 